//
//  LBUIKitMacroDefinition.h
//  LBUIKit
//
//  Created by WuShiHai on 19/5/24.
//  Copyright (c) 2019 Lebbay. All rights reserved.
//

#ifndef LBUIKitMacroDefinition_h
#define LBUIKitMacroDefinition_h

//获取屏幕宽度与高度
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define SCREEN_WIDTH   [UIScreen mainScreen].bounds.size.width
#define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREENH_HEIGHT))
#define IS_IPHONE_X (IS_IPHONE && (SCREEN_MAX_LENGTH == 812.0 || SCREEN_MAX_LENGTH == 896.0))
#define IPHONE_X_BOTTOM_MARGIN 34.0f
#define IPHONE_NAVIGATION_BAR_HEIGHT (IS_IPHONE_X ? 20 + 64 : 64)
#define IPHONE_BOTTOM_MARGIN (IS_IPHONE_X ? IPHONE_X_BOTTOM_MARGIN : 0)
#define IPHONE_TAB_BAR_HEIGHT (IPHONE_BOTTOM_MARGIN + 49)

//设置RGB颜色/设置RGBA颜色
#define LBRGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define LBRGBAColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(r)/255.0 blue:(r)/255.0 alpha:a]

//设置 view 圆角和边框
#define LBViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]]

//获取frame
#define LBRectMinusHeight(rect, height) \
CGRectMake(CGRectGetMinX(rect), \
           CGRectGetMinY(rect), \
           CGRectGetWidth(rect), \
           CGRectGetHeight(rect) - height)

#endif /* LBUIKitMacroDefinition_h */
